<template>
	<view class="ward">
		<view class="amount">
			<view>{{ title }}</view>
			<view :style="item.amount < 0 ? 'color:#FC4E4C' : 'color:#006DFF'">{{ item.amount > 0 ? ('+￥' + item.amount)
					: (item.amount.slice(0, 1) + '￥' + item.amount.slice(1))
			}}</view>
		</view>
		<view>
			<view class="orders">
				<view>
					<image
						src="https://res.jiuzhang-cloud.com/jzy-oss/upload/image/dti-hospital/agencies/orders_number.png">
					</image>
					<view>订单号</view>
				</view>
				<view>{{ item.orderCode }}
				</view>
			</view>
			<view class="orders">
				<view>
					<image
						src="https://res.jiuzhang-cloud.com/jzy-oss/upload/image/dti-hospital/agencies/orders_commodity.png">
					</image>
					<view>商品名</view>
				</view>
				<view>
					<view v-for="(value, index) in item.commodityNameList" :key="index">
						{{ value }}
					</view>
				</view>
			</view>
			<view class="orders">
				<view>
					<image
						src="https://res.jiuzhang-cloud.com/jzy-oss/upload/image/dti-hospital/agencies/orders_time.png">
					</image>
					<view>订单时间</view>
				</view>
				<view>{{ item.createdTime }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		title: {
			type: String,
			default: '已发货'
		}
		,
		item: {  //记录列表
			type: Object,
			default: {
				"orderCode": "TP20220704191904583",
				"busType": null,
				"busTypeName": null,
				"amount": "13.30",
				"createdTime": "2022-07-14 16:34:13",
				"commodityNameList": [
					"999感冒灵颗粒"
				],
				"statusName": null
			}
		},
	},
	data() {
		return {
		}
	},
	methods: {

	}
}
</script>

<style lang="less">
.ward {
	background: #FFFFFF;
	border-radius: 24rpx;
	padding: 0 24rpx;
	margin-bottom: 24rpx;

	.amount {
		display: flex;
		justify-content: space-between;
		padding: 24rpx 0;
		border-bottom: 2rpx solid #E5E5E5;

		view {
			font-size: 32rpx;
		}

		>view:nth-child(1) {
			color: #222222;
		}
	}

	.orders {
		display: flex;
		justify-content: space-between;
		padding-bottom: 24rpx;
		font-size: 28rpx;

		>view:nth-child(1) {
			display: flex;
		}

		>view:nth-child(1)>view {
			color: #B0B2B1;
		}

		view:nth-child(2) {
			color: #6B6970;
			text-align: right;
		}

		image {
			width: 28rpx;
			height: 28rpx;
			// margin: auto 0;
			margin-top: 7rpx;
			margin-right: 26rpx;
		}
	}

	.orders:nth-child(1) {
		padding-top: 24rpx;
	}

}
</style>
